package firstStage.part6;

/**
 * @ClassName: [Demo1]
 * @Description:
 * @Author: [黄劲松]
 * @CreateDate: [2021-02-06]
 * @Version: [v1.0]
 */
/*百钱白鸡
需求:我国古代数学家张丘建在《算经》-书中提出的数学问题:
鸡翁-值钱五， 鸡母-值钱三, 鸡雏三值钱。
        百钱买百鸡，问鸡翁、鸡母鸡雏各几何?
思路：设鸡翁x只，鸡母y只，鸡雏z只
x+y+z=100；
5*x+3*y+3*z=100
*/
public class Demo1 {
    public static void main(String[] args) {
        for (int x = 0; x <= 20; x++) {
            for (int y = 0; y <= 33; y++) {
                int z = 100 - x - y;
                if (z % 3 == 0 && 5 * x + 3 * y + z / 3 == 100) {
                    System.out.println(x + "," + y + "," + z);
                }
            }
        }
    }
}
